const cloud = require('wx-server-sdk');

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();

// 查询数据库集合云函数入口函数
exports.main = async (event, context) => {
  switch (event.action) {
    case 'select':
      return await db.collection('exercise_category').get();
    default:
      console.log("action " + event.action + "undefined")
  }
  
};
